/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_OBJECT_PCIE_GPU_CARD_GPU_H
#define GEN_OBJECT_PCIE_GPU_CARD_GPU_H

#include <device_tree/base.h>
#include <device_tree/interface/Gpu.h>
#include <device_tree/interface/Gpu/Power.h>
#include <device_tree/interface/Gpu/Status.h>
#include <device_tree/interface/Processor.h>

namespace dev::gen {

/**
 * @brief GPU驱动类
 *
 * 实现GPU的驱动功能，作为PCIeGpuCard的子设备
 */
class MC_API gpu : public mc::engine::object<gpu> {
public:
    MC_OBJECT(gpu, "GraphicsController", "${Parent}/GraphicsController/{Id}", (Processor)(Gpu)(Gpu_Power)(Gpu_Status))

    virtual bool init(const mc::dict& config) = 0;
    virtual bool start()                      = 0;
    virtual bool stop()                       = 0;

    Processor  m_processor;
    Gpu        m_gpu;
    Gpu_Power  m_gpu_power;
    Gpu_Status m_gpu_status;
};

} // namespace dev::gen

#endif // GEN_OBJECT_PCIE_GPU_CARD_GPU_H